package com.bestbuy.pojo;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;


/**
 * @author ThanhNgo
 *
 */
@Entity
@Table(name = "product")
public class Product {
	@Id
    @Column(name="IDPRODUCT")
    @GeneratedValue	
	private Integer idProduct;
	
	@Fetch(FetchMode.JOIN)
	@ManyToOne
    @JoinColumn(name="IDCATALOG")
	private Catalog catalog;
	
//	@OneToMany(mappedBy="product", fetch = FetchType.LAZY)
//	private Set<Comment> comments = new HashSet<Comment>(0);
	

	@Column(name="PRODUCTCODE")
	private String productCode;
	
	@Column(name="PRODUCTNAME")
	private String productName;
	
	
	@Column(name="QUANTITY")
	private Integer quantity;
	
	@Column(name="PRICE")
	private Float price;
	
//	@Column(name="LINKIMAGE")
//	private String linkImage;
	
	@Column(name = "ISDELETED")
	private Integer isDeleted;

	public Integer getIdProduct() {
		return idProduct;
	}

	public void setIdProduct(Integer idProduct) {
		this.idProduct = idProduct;
	}

	public Catalog getCatalog() {
		return catalog;
	}

	public void setCatalog(Catalog catalog) {
		this.catalog = catalog;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		this.productCode = productCode;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		this.productName = productName;
	}

	public Integer getQuantity() {
		return quantity;
	}

	public void setQuantity(Integer quantity) {
		this.quantity = quantity;
	}

	public Float getPrice() {
		return price;
	}

	public void setPrice(Float price) {
		this.price = price;
	}

//	public String getLinkImage() {
//		return linkImage;
//	}
//
//	public void setLinkImage(String linkImage) {
//		this.linkImage = linkImage;
//	}

	public Integer getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Integer isDeleted) {
		this.isDeleted = isDeleted;
	}



	public Product(Integer idProduct, Catalog catalog,
			String productCode, String productName, Integer quantity,
			Float price, String linkImage, Integer isDeleted) {
		super();
		this.idProduct = idProduct;
		this.catalog = catalog;
//		this.comments = comments;
		this.productCode = productCode;
		this.productName = productName;
		this.quantity = quantity;
		this.price = price;
//		this.linkImage = linkImage;
		this.isDeleted = isDeleted;
	}

	public Product() {
//		super();
		// TODO Auto-generated constructor stub
	}
	
	
	
}
